home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / packet / tcpip / sys5 / iscwmpst.z / iscwmpst / tcp / src / ftp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-26  |  1.8 KB  |  59 lines

  1. /* @(#) $Header: ftp.h,v 1.4 91/04/25 18:26:50 deyke Exp $ */
  2.  
  3. #ifndef _FTP_H
  4. #define _FTP_H
  5.  
  6. /* Definitions common to both FTP servers and clients */
  7.  
  8. #define CTLZ    26              /* EOF for CP/M systems */
  9.  
  10. /* Per-session control block */
  11. struct ftp {
  12.     struct ftp *prev;       /* Linked list pointers */
  13.     struct ftp *next;
  14.     struct tcb *control;    /* TCP control connection */
  15.     char state;
  16. #define COMMAND_STATE   0       /* Awaiting user command */
  17. #define SENDING_STATE   1       /* Sending data to user */
  18. #define RECEIVING_STATE 2       /* Storing data from user */
  19.  
  20.     char type;              /* Transfer type */
  21. #define IMAGE_TYPE      0
  22. #define ASCII_TYPE      1
  23.  
  24.     FILE *fp;               /* File descriptor being transferred */
  25.     struct socket port;     /* Remote port for data connection */
  26.     struct tcb *data;       /* Data connection */
  27.  
  28.     /* The following are used only by the server */
  29.     char *username;         /* Arg to USER command */
  30.     char *path;             /* Allowable path prefix */
  31.     char perms;             /* Permission flag bits */
  32. #define FTP_READ        1       /* Read files */
  33. #define FTP_CREATE      2       /* Create new files */
  34. #define FTP_WRITE       4       /* Overwrite or delete existing files */
  35.  
  36.     char *buf;              /* Input command buffer */
  37.     char cnt;               /* Length of input buffer */
  38.     char *cd;               /* Current directory name */
  39.  
  40.     int uid;                /* User ID */
  41.     int gid;                /* Group ID */
  42.  
  43.     /* And this is used only by the client */
  44.     struct session *session;
  45. };
  46.  
  47. #define NULLFTP (struct ftp *)0
  48.  
  49. /* In ftp.c: */
  50. void ftpdr __ARGS((struct tcb *tcb, int cnt));
  51. void ftpdt __ARGS((struct tcb *tcb, int cnt));
  52. struct ftp *ftp_create __ARGS((unsigned bufsize));
  53. void ftp_delete __ARGS((struct ftp *ftp));
  54.  
  55. /* In ftpcli.c: */
  56. void ftpccr __ARGS((struct tcb *tcb, int cnt));
  57.  
  58. #endif  /* _FTP_H */
  59.